<?php
$topMenu = service_menu::getTopMenu();
$menus = service_menu::getAll();

$cache = new Cache_request();
if($cache->has('currentID')){
	$menuID = $cache->get('currentID',0);
}else{
	$menuID = 0;
}
$currentID = service_menu::getTopParentID($menuID);
?>
<ul>
	<li class="link"><a class="<?php if($currentID==0) echo 'current';?>" href="<?php echo url('index');?>"><span>首页</span></a></li>
	<?php foreach($topMenu as $item):?>
	<li class="link">
	<a class="<?php if($currentID==$item['id']) echo 'current';?>" href="<?php echo service_menu::getUrlByID($item['id']);?>"><span><?php echo $item['title'];?></span></a>
	</li>
	<?php endforeach;?>
</ul>
